package com.elitesland.b2c.com.convert;

import com.elitesland.b2c.com.entity.ComAreaDO;
import com.elitesland.b2c.com.vo.resp.ComAreaDetailRespVO;
import com.elitesland.b2c.com.vo.save.ComAreaSaveVO;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.factory.Mappers;

/**
 * <p>
 * 功能说明
 * </p>
 *
 * @author fred
 * @since 2021-02-01 17:29:33
 */
@Mapper
public interface ComAreaConvert {

    ComAreaConvert INSTANCE = Mappers.getMapper(ComAreaConvert.class);

    /**
     * 保存参数转DO
     *
     * @param saveVO 保存参数数据
     * @return DO
     */
    ComAreaDO saveVO2DO(ComAreaSaveVO saveVO);

    /**
     * 复制saveVO至DO
     *
     * @param saveVO 保存参数数据
     * @param target 原DO数据
     */
    void saveVO2DO(ComAreaSaveVO saveVO, @MappingTarget ComAreaDO target);

    /**
     * do转RespVO
     *
     * @param doo 区域DO
     * @return respVO
     */
    ComAreaDetailRespVO do2RespVO(ComAreaDO doo);

}